# Maintainer: Sergej Pupykin <arch+pub@sergej.pp.ru>
# Maintainer: Leonard de Ruijter <leonard@aur.archlinux.org>
# Contributor: Hubert Kario <hubert@kario.pl>
# Contributor: Artyom Smirnov <smirnoffjr@gmail.com>

pkgname=opendbx
pkgver=1.4.6
pkgrel=11
pkgdesc="Extremely lightweight but extensible database access library written in C."
arch=('loong64' 'x86_64')
url="https://www.linuxnetworks.de/doc/index.php/OpenDBX"
license=('LGPL')
depends=('libfbclient' 'mariadb-libs' 'postgresql-libs' 'sqlite' 'freetds')
source=(https://linuxnetworks.de/opendbx/download/${pkgname}-${pkgver}.tar.gz
        'opendbx.patch')
sha256sums=('2246a03812c7d90f10194ad01c2213a7646e383000a800277c6fb8d2bf81497c'
            '786f9622791de113bfe1ee9fc2fdc42ea4a58d31a006db1dc91ffd7fb8b6deeb')

prepare() {
  cd "${pkgname}-${pkgver}"
  patch -up1 <"$srcdir/opendbx.patch"
}

build() {
  cd "${pkgname}-${pkgver}"
  CPPFLAGS=${CPPFLAGS}" -I/usr/include/mysql"\
  ./configure --with-backends="firebird mysql mssql odbc pgsql sqlite3 sqlite3 sybase" \
              --prefix=/usr
  make all
}
check() {
  cd "$pkgname-$pkgver"
  make check
}

package() {
  cd "${pkgname}-${pkgver}"
  make DESTDIR="${pkgdir}/" install
}

# vim:set ts=2 sw=2 et:
